<!-- 备注编辑弹窗 -->
<template>
  <ele-modal
    form
    width="95%"
    :model-value="modelValue"
    :title="title"
    @update:modelValue="updateModelValue"
  >
    <list
      action="list"
      :action-status="200"
      :company-id="props.data.company_id"
      :belongs-date="props.belongsDate"
      :search="false"
    />
  </ele-modal>
</template>

<script setup>
  import { ref, watch } from 'vue';
  import list from '@/views/company/invoice/components/list.vue';
  const props = defineProps({
    /** 弹窗是否打开 */
    modelValue: Boolean,
    data: Object,
    belongsDate: String
  });
  const emit = defineEmits(['done', 'update:modelValue']);

  /** 更新modelValue */
  const updateModelValue = (value) => {
    emit('update:modelValue', value);
  };

  const title = ref('');

  watch(
    () => props.modelValue,
    (modelValue) => {
      if (modelValue) {
        title.value = props.data.company + ' 的开票记录';
      } else {
        console.log('什么也没发生');
      }
    }
  );
</script>
